<?php
/**
 * Created by PhpStorm
 * User: honglin
 * Date: 2022/8/4
 * Time: 上午10:55
 */

namespace App\Library\Login;


class CheckPassword
{
    protected $errCode = LoginCode::PASSWORD;

    public function handle(LoginLibrary $LoginLibrary,$next){

        /** @var \App\Model\System\SystemAdmin $adminInfo */
        $adminInfo = $LoginLibrary->getAdminInfo();

        if($adminInfo->password == $LoginLibrary->getEncryptPassword()){
            return $next($LoginLibrary);
        }
        return $this->errCode;
    }

}